// pages/user/index.js
Page({
  data: {
    userInfo: {},
    collectNums: 0 //收藏数量
  },
  onShow() {
    let userInfo = wx.getStorageSync('userInfo');  
    let collect = wx.getStorageSync('collect') || [];
    let collectNums = collect.length
    this.setData({
      userInfo,
      collectNums
    })
  }
})